﻿<UserControl x:Class="ContactTracing.CaseView.Controls.RecordErrors"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="700">

    <Grid>
        <Grid.Background>
            <SolidColorBrush Color="Black" Opacity="0.4" />
        </Grid.Background>

        <Border HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="1" BorderBrush="{StaticResource HighlightBrush}">
            <Grid Width="Auto" Height="Auto" Background="{StaticResource LightBackgroundBrush}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <StackPanel Margin="20">

                    <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />



                    <TextBlock Style="{StaticResource Heading1}">ERRORS</TextBlock>

                    <StackPanel Height="10" />

                    <TextBlock TextWrapping="WrapWithOverflow">The following errors were detected in this record:</TextBlock>

                    <StackPanel Height="20" />

                    <DataGrid ItemsSource="{Binding Errors.ErrorMessageCollection}"
                              Style="{StaticResource DataGridDemoStyle}"
                              IsReadOnly="True"
                              CanUserAddRows="False"
                              CanUserDeleteRows="False"
                              CanUserReorderColumns="False"
                              CanUserResizeRows="False"
                        Height="200" Width="600" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" AutoGenerateColumns="True">
                        <!--<DataGrid.Columns>
                            <DataGridTextColumn IsReadOnly="True" Header="Field" Binding="{Binding FieldName}" />
                            <DataGridTextColumn IsReadOnly="True" Header="Error Message" Binding="{Binding ErrorMessage}" />
                        </DataGrid.Columns>-->
                    </DataGrid>

                    <StackPanel Height="20" />

                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                        <Button
                                    Content="Close"
                                    Command="{Binding ToggleErrorDisplayCommand}"
                                    Width="90" Margin="0, 0, 0, 0" />
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>
